import request from "../utils/request"//导入request实例对象
//将与服务端的交互代码放在api这一层
//查询部门
export const queryAllApi = ()=>request.get('/depts')//箭头函数：若有返回值，可以简写将return和{}删掉
//新增部门
export const addApi=(dept)=>request.post('/depts',dept)
//根据id查询部门
export const queryByIdApi =(id)=>request.get(`/depts/${id}`)
//修改部门
export const updateApi =(dept)=>request.put('/depts',dept)
//删除部门
export const deleteByIdApi =(id)=>request.delete(`/depts?id=${id}`)